home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / text+faqs / trekguide / trekguide.rexx < prev    next >
OS/2 REXX Batch file  |  1996-02-26  |  4KB  |  115 lines

  1. /*
  2.  Trek-The Guide v1.6 Arexx Front End
  3.  ©1994-1995 Jim Hines All rights Reserved - - - - AmigaGuide Version
  4.  */
  5.  
  6. NL = '0a'x
  7.  
  8.  
  9. if ~show('L','rexxsupport.library') then
  10.     call addlib('rexxsupport.library',0,-30)
  11. if ~show('L','rexxarplib.library') then
  12.     call addlib('rexxarplib.library',0,-30)
  13. /*if ~show('L','rexxreqtools.library') then
  14.     call addlib('rexxreqtools.library',0,-30)*/
  15.  
  16. if ~exists('env:Trekguide.prefs') then do
  17.     call Request(100, 100,"ENV:Trekguide.prefs DOES NOT EXIST\You MUST create it by using the\TG-Screen program." ,, "Live Long and Prosper",,)
  18.     exit
  19. end
  20.  
  21. /* This is the same as above but uses the RexxReqTools.library instead  */
  22. /*if ~exists('env:Trekguide.prefs') then do
  23.     call rtezrequest( "ENV:Trekguide.prefs DOES NOT EXIST" || NL || "You MUST create it by using"||NL||"the TG-Screen program.", " OK ", , )
  24.     exit
  25.     end*/
  26.  
  27. screenmode = open(sm, 'env:Trekguide.prefs', 'r')
  28. smvar = readln(sm)
  29. close(sm)
  30. parse var smvar width '|' height
  31. /*say 'the width is 'width
  32. say 'the height is 'height*/
  33.  
  34.  
  35. call openport(notifyport)
  36. call openscreen(0, 4, hireslace, 'Trek-The.Guide v1.6 ©1994-1995 Jim Hines', trekguide,, width, height, 0)
  37. /* why the hell does does it look for the rexxreqtools.library for the arp openscreen call??????? */
  38.  
  39. /* WORKBENCH COLORS */
  40.     Screencolor(trekguide, 0, 8, 8, 7)
  41.     Screencolor(trekguide, 1, 0, 0, 0)
  42.     Screencolor(trekguide, 2, 0, 15, 15)
  43.     Screencolor(trekguide, 3, 14, 14, 3)
  44.     Screencolor(trekguide, 4, 7, 7, 15)
  45.     Screencolor(trekguide, 5, 15, 15, 15)
  46.     Screencolor(trekguide, 6, 11, 10, 9)
  47.     Screencolor(trekguide, 7, 15, 11, 10)
  48.  
  49. /*  PIC COLORS */
  50.     Screencolor(trekguide, 8, 0, 0, 0)
  51.     Screencolor(trekguide, 9, 1, 1, 1)
  52.     Screencolor(trekguide, 10, 3, 3, 3)
  53.     Screencolor(trekguide, 11, 5, 5, 5)
  54.     Screencolor(trekguide, 12, 7, 7, 7)
  55.     Screencolor(trekguide, 13, 9, 9, 9)
  56.     Screencolor(trekguide, 14, 10, 10, 10)
  57.     Screencolor(trekguide, 15, 12, 12, 12)
  58.  
  59. address ARexx "'call CreateHost(hostport, notifyport, trekguide)'"
  60.  
  61. WaitForPort hostport
  62. WaitForPort hostport
  63. WaitForPort hostport
  64.  
  65. /* ========THESE DIRS & FILES PERTAIN TO THE MARK AND VIEW COMMANDS === */
  66.  
  67. address command 'makedir >nil: env:TrekGuide'
  68. if exists('envarc:TrekGuide') then do
  69.     address command    'copy envarc:TrekGuide all env:TrekGuide'
  70.     call PostMsg(0, 0,'Loading previously saved episode list.', TREKGUIDE)
  71.     end
  72.  
  73. /* ========These section is for the opening IFF === */
  74.  
  75. idcmp = 'CLOSEWINDOW+GADGETUP'
  76. flags = 'BACKFILL+ACTIVATE'
  77.  
  78. address ARexx "'call CreateHost(hostport, notifyport, trekguide)'"
  79.  
  80. WaitForPort hostport
  81. WaitForPort hostport
  82.  
  83. call OpenWindow(hostport, 10, 10, 557, 364, idcmp, flags, 'PLEASE WAIT WHILE LOADING')
  84. call SetNotify(hostport, CLOSEWINDOW, hostport)
  85.  
  86. call IFFImage(hostport, 'TREKGUIDE:TREKPICS/OPENPIC', 5, 11, 561, 366, nocolor)
  87. closeport(hostport)
  88. call delay(200)
  89. call closewindow(hostport)
  90. call PostMsg()
  91.  
  92. /* ======== END IFF SECTION THEN LOAD MAIN GUIDE FILE ===*/
  93.  
  94. address command 'amigaguide TREKGUIDE:Trek-The.guide pubscreen TREKGUIDE'
  95.  
  96. /* ========= THIS SECTION IS FOR THE SAVING OF MARKED EPISODES === */
  97. number = FileList('ENV:TREKGUIDE/*', files, , N)
  98. if number = 0 then do 
  99.     call trekexit()
  100.     end
  101.  
  102. envfiles = Request(200, 50, 'Do you wish to save your\marked episodes for later?', , YES, NO, TREKGUIDE)
  103.     if envfiles = 'OKAY' then do
  104.     address command 'copy >nil: env:trekguide all envarc:TrekGuide'
  105.     end
  106.     else 
  107.     address command 'delete >NIL: envarc:TrekGuide all'
  108. /* ======== END OF MARKED EPISODES SECTION ===*/
  109.  
  110. trekexit:
  111. closescreen(trekguide)
  112. address command 'delete >NIL: env:TrekGuide all'
  113. address command 'avail flush >nil:' /* flushes the no longer needed libs from memory */
  114. exit
  115.